<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="../../css/style.css" rel="stylesheet" type="text/css">
<title>회원가입</title>
</head>
<script language="javascript">
	function id_chk(){
		var idfrm = document.idchkFrm;
		idfrm.login_name.value = document.infoFrm.login_name.value;
		var pop = window.open("id_check.jsp","idchk","top=1px, left=1px, width=1px, height=1px")
		idfrm.submit();  //값을 전송한다.
		popup.focus();  //팝업창에 포커스를 이동시킨다.
	}

	function insert_chk(){
		var frm = document.infoFrm;
		var phone = frm.phone1.value + "-" + frm.phone2.value + "-" + frm.phone3.value;
		frm.phone.value = phone;
		 if(frm.login_name.value=="" || frm.login_name.value==null){
			 alert("아이디를 입력하지 않았습니다.");
			 frm.login_name.focus();}
		 else if(frm.pw.value=="" || frm.pw.value==null){
			 alert("비밀번호를 입력하지 않았습니다.");
			 frm.pw.focus();}
		 else if(frm.name.value=="" || frm.name.value==null){
			 alert("이름을 입력하지 않았습니다.");
			 frm.name.focus();}
		 else if(frm.phone1.value=="" || frm.phone1.value==null){
			 alert("연락처를 입력하지 않았습니다.");
			 frm.phone1.focus();}
		 else if(frm.phone2.value=="" || frm.phone2.value==null){
			 alert("연락처를 입력하지 않았습니다.");
			 frm.phone2.focus();}
		 else if(frm.phone3.value=="" || frm.phone3.value==null){
			 alert("연락처를 입력하지 않았습니다.");
			 frm.phone3.focus();}
		 else frm.submit();
	}
</script>
<body>
	<form name="infoFrm" action="insertMember_proc.jsp" method="post">
		<div class="bodystyle">
			<table width="800" align="center">
				<tr>
					<td colspan=2><img src="../../images/join_top.jpg"><br></td>
				</tr>
				<tr>
					<td class="bodytitle" width="10%" align="right">아이디</td>
					<td><input type=text name=login_name size="15" class="bodystyle">&nbsp;<input type="button" class="buttonstyle" value="중복 확인" onclick="id_chk();"/></td>
				</tr>
				<tr>
					<td class="bodytitle" align="right">비밀번호</td>
					<td><input type=password name=pw size="15" class="bodystyle"></td>
				</tr>
			</table>
			<table width="800" align="center">
				<tr>
					<td class="titlestyle"><br>회원정보</td>
				</tr>
				<tr>
					<td width="10%" class="bodytitle" align="right">이름</td>
					<td><input type=text name=name size="12" class="bodystyle"></td>
				</tr>
				<tr>
					<td class="bodytitle" align="right">연락처</td>
					<td>
						<input type=text name=phone1 size="3" class="bodystyle">-
						<input type=text name=phone2 size="4" class="bodystyle">-
						<input type=text name=phone3 size="4" class="bodystyle">
						<input type=hidden name=phone>
					</td>
				</tr>
			</table>
		</div>
	</form>
	<form target="idchk" action="id_check.jsp" name="idchkFrm">
		<input type=hidden name=login_name>
	</form>
	<div align="center">
		<button onclick="insert_chk();" class="buttonstyle" style="width:150px">가입하기</button>
	</div>
	<div id="footer" style="margin:0px auto;" align="center">
			<iframe src="../../bottom.html" frameborder=0 width="850px"></iframe>
	</div>
</body>
</html>